# set up directory structure
results_path <- "results/replication/"
if (!dir.exists(results_path)) {
  dir.create(results_path, recursive = TRUE)
}
if (!dir.exists("figures")) {
  dir.create("figures")
}
if (!dir.exists("tables")) {
  dir.create("tables")
}
if (!dir.exists("data")) {
  dir.create("data", recursive = TRUE)
}
if (!dir.exists("R")) {
  dir.create("R", recursive = TRUE)
}
if (!file.exists("data/data-2021-02-22.RData")) {
  file.rename("data-2021-02-22.RData", "data/data-2021-02-22.RData")
}
if (!file.exists("R/01-set-up-directory-structure.R")) {
  files <- list.files(getwd())
  for (file in files[files %like% "\\.R$"]) {
    file.rename(file, paste0("R/", file))
  }
}
